#pragma once
#include "order.h"
#include "trade.h"

struct OrderEvent {
    Order order;
    OrderStatus status;
};

struct TradeEvent {
    Trade trade;
};

struct ErrorEvent {
    OrderError error;
};

// 事件处理器适配器
template <typename T, typename Callback>
class EventHandlerAdapter : public EventHandler<T> {
public:
    explicit EventHandlerAdapter(Callback callback) 
        : callback_(std::move(callback)) {}

    void handle(const T& event) override {
        callback_(event);
    }

private:
    Callback callback_;
};